package com.example.weatherforecast.data.city.persistence.dao

import androidx.lifecycle.LiveData
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.example.weatherforecast.data.city.persistence.entity.CityInfo

@Dao
interface CityInfoDao {

    @Insert
    fun insert(cityInfoList: List<CityInfo>)

    @Query("select * from city_info where city_name = :cityName and city_level = 3")
    fun queryByCityName(cityName: String): CityInfo

    @Query("select * from city_info")
    fun queryAll(): List<CityInfo>

    @Query("select * from city_info where city_name like :cityStr")
    fun queryAllBlur(cityStr: String): List<CityInfo>

    @Query("delete from city_info")
    fun clearTableData()

}